import local from '@/utils/localStoreUtils.js'
const initUser = local.getT('USER') || {}
function userReducer(state = initUser, action) {
  switch (action.type) {
    case 'setUser':
      local.saveT('USER', action.data)
      return action.data
    case 'getUser':
      return state
    case 'clear':
      local.clear()
      return {}
    default:
      return state
  }
}
export default userReducer
